package com.sv.zgydor.pojo.pg;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Class summary
 * User: kevin
 * Date: 2017/09/19
 * Time: 17:16
 * Description:
 */
@Entity
@Table(name = "t_project_list", catalog = "\"dgor-dsg\"")
public class TProjectListEntity {
    private int pid;
    private Integer userid;
    private String name;
    private Timestamp createDate;
    private Integer visitCnt;
    private String sid;
    private Integer year;
    private Integer timeLine;
    private int geomType;
    private String img;

    @Id
    @Column(name = "pid", nullable = false)
    public int getPid() {
        return pid;
    }

    public void setPid(int pid) {
        this.pid = pid;
    }

    @Basic
    @Column(name = "userid", nullable = true)
    public Integer getUserid() {
        return userid;
    }

    public void setUserid(Integer userid) {
        this.userid = userid;
    }

    @Basic
    @Column(name = "name", nullable = true, length = 254)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "create_date", nullable = true)
    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    @Basic
    @Column(name = "visit_cnt", nullable = true)
    public Integer getVisitCnt() {
        return visitCnt;
    }

    public void setVisitCnt(Integer visitCnt) {
        this.visitCnt = visitCnt;
    }

    @Basic
    @Column(name = "sid", nullable = false, length = 15)
    public String getSid() {
        return sid;
    }

    public void setSid(String sid) {
        this.sid = sid;
    }

    @Basic
    @Column(name = "year", nullable = true)
    public Integer getYear() {
        return year;
    }

    public void setYear(Integer year) {
        this.year = year;
    }

    @Basic
    @Column(name = "time_line", nullable = true)
    public Integer getTimeLine() {
        return timeLine;
    }

    public void setTimeLine(Integer timeLine) {
        this.timeLine = timeLine;
    }

    @Basic
    @Column(name = "geom_type", nullable = false)
    public int getGeomType() {
        return geomType;
    }

    public void setGeomType(int geomType) {
        this.geomType = geomType;
    }

    @Basic
    @Column(name = "img", nullable = true, length = 254)
    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TProjectListEntity that = (TProjectListEntity) o;

        if (pid != that.pid) return false;
        if (geomType != that.geomType) return false;
        if (userid != null ? !userid.equals(that.userid) : that.userid != null) return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;
        if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
        if (visitCnt != null ? !visitCnt.equals(that.visitCnt) : that.visitCnt != null) return false;
        if (sid != null ? !sid.equals(that.sid) : that.sid != null) return false;
        if (year != null ? !year.equals(that.year) : that.year != null) return false;
        if (timeLine != null ? !timeLine.equals(that.timeLine) : that.timeLine != null) return false;
        if (img != null ? !img.equals(that.img) : that.img != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = pid;
        result = 31 * result + (userid != null ? userid.hashCode() : 0);
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
        result = 31 * result + (visitCnt != null ? visitCnt.hashCode() : 0);
        result = 31 * result + (sid != null ? sid.hashCode() : 0);
        result = 31 * result + (year != null ? year.hashCode() : 0);
        result = 31 * result + (timeLine != null ? timeLine.hashCode() : 0);
        result = 31 * result + geomType;
        result = 31 * result + (img != null ? img.hashCode() : 0);
        return result;
    }
}
